import MComponent from '../../common/MComponent'
const navs = [
  {
    bg: 'http://rongmin.1juke.cn/upload/brand1.png',
    title: '品牌荣誉',
    desc: '坚持奉献为荣\n忠诚为民',
    link: '/pages/news/detail?id=20'
  },
  {
    bg: 'http://rongmin.1juke.cn/upload/brand2.png',
    title: '荣民地产',
    desc: '创造宜居环境\n勇攀高峰',
    link: '/pages/news/detail?id=21'
  },
  {
    bg: 'http://rongmin.1juke.cn/upload/brand3.png',
    title: '光彩公益',
    desc: '发扬致富思源\n扶危济困',
    link: '/pages/news/detail?id=22'
  }
]
MComponent({
  data: {
    navs,
    current: 0
  },
  computed : {
    bg () {
      const { navs, current } = this.data
      return navs[current].bg
    },
    link () {
      const { navs, current } = this.data
      return navs[current].link
    }
  },
  methods: {
    onTap (e) {
      const { index: current } = e.currentTarget.dataset
      this.set({
        current
      })
    },
    onLoad (options) {},
    onShow () {}
  }
}, true)